-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blit #21
Open
Phylex
wants to merge
17
commits into
daschr:main
Choose a base branch
from
Phylex:blit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Blit #21
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of encoding font properties in the bitmap buffer, Encode them in a struct, thus removing magic numbers in the code
When using the built in font, it creates a conflict in the linker as the symbol font5x8 is defined twice (once in the executable and once in the 'library'. As this is a fairly trivial wrapper, the user can recreate it with their 'default' font for the project.
Instead of having the CPU Idle while the Data is being transfered to the Display, Use the DMA engine to transfer display buffer into the I2C peripheral. allowing the CPU time to be used otherwise. The use of the DMA needed to change the way the peripheral is initialized. Most of the data initialization is done via a Macro that sets up all the necessary data in the display struct. To initialize the display, the ssd1306_init function still needs to be run. The define also changes the implementation of the 'ssd1306_show' function to use the DMA instead of 'fancy_write' Also add commands to the CMakeLists.txt file of the example to allow for changing the compile Define on the target.
The example is modified so that during build time DMA mode may be selected or standard mode. Due to a small added delay due to copying data into the DMA tx buffer the sleep time needed to be increased to eliminate tearing.
Blitting moves a sprite into the display buffer while in this case using bit wise operations to accomplish this with fewer CPU cycles than using the draw pixel functions
Changed things such that the build system can straight up import the src directory as a subdirectory. Changed the example CMake to do this moved the fonts into their own directory and included that in the build system. Added the start of a widget system to the ssd1306 display (developed for other projects).
Create a new subfolder and update the example folder to include the subfolders containing our examples
The new example shows the text typed over a serial interface on the ssd1306, including basic control char handling
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a quite large Code restructure, as well as adding a simple text widget.
The code assumes that the 'blit' function is the core function of the display code, this splits the responsibility of rendering to the display into the preparation of the sprite and the placement of the sprite into the display buffer (the blitting). Widgets are the things that prepare the sprites, which are to be placed into the display buffer. This code is a mild refactor of the original code, where most of the text functions are moved into a set of widget functions that operate on a sprite, before having the sprite copied into the display buffer.
The build system has also been reworked so as to place the library files into the src directory, the fonts into their own directory (as they are in a sense "data" and not code). and also added an example showing how to use the text widget together with raw (avoiding pico stdio) usb-serial that allows to display text typed on the keyboard on the ssd1306.
Besides this there are some small tweaks in the display struct creation macro.